package com.gitee.wsl.compose.ui.base

import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.RowScope


/**
 * creator: lt  2021/4/13  lt.dygzs@qq.com
 * effect : 间隔view
 *          Spacers
 * warning:
 */

object Spacer

/**
 * 设置横向间隔dp
 * Spacer with horizontal
 */
@Composable
fun Spacer.Horizontal(dp: Int) {
    Spacer(Modifier.width(dp.dp))
}

@Composable
fun Spacer.Horizontal(dp: Dp) {
    Spacer(Modifier.width(dp))
}

/**
 * 设置竖向间隔dp
 * Spacer with vertical
 */
@Composable
fun Spacer.Vertical(dp: Int) {
    Spacer(Modifier.height(dp.dp))
}

@Composable
fun Spacer.Vertical(dp: Dp) {
    Spacer(Modifier.height(dp))
}

@Composable
fun RowScope.SpacerW1() {
    Box(Modifier.weight(1f))
}

@Composable
fun ColumnScope.SpacerW1() {
    Box(Modifier.weight(1f))
}